/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package negocio;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Dvid
 */
@Embeddable
public class FichaMedicamPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "fichaid")
    private int fichaid;
    @Basic(optional = false)
    @Column(name = "medicamid")
    private int medicamid;

    public FichaMedicamPK() {
    }

    public FichaMedicamPK(int fichaid, int medicamid) {
        this.fichaid = fichaid;
        this.medicamid = medicamid;
    }

    public int getFichaid() {
        return fichaid;
    }

    public void setFichaid(int fichaid) {
        this.fichaid = fichaid;
    }

    public int getMedicamid() {
        return medicamid;
    }

    public void setMedicamid(int medicamid) {
        this.medicamid = medicamid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) fichaid;
        hash += (int) medicamid;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FichaMedicamPK)) {
            return false;
        }
        FichaMedicamPK other = (FichaMedicamPK) object;
        if (this.fichaid != other.fichaid) {
            return false;
        }
        if (this.medicamid != other.medicamid) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "negocio.FichaMedicamPK[ fichaid=" + fichaid + ", medicamid=" + medicamid + " ]";
    }
    
}
